﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tomasulo_Simulator
{
    class Processor
    {
        public static Processor processor;
        public enum Operation { LW, SW, JMP, BEQ, JALR, RET, ADD, ADDI, NAND, MUL, DIV }

        public ReorderBuffer ROB;
        InstructionBuffer instructionBuffer;
        List<ReservationStation> reservationStations;
        int[] registers;
        int reservationStationsCount;

        public int[] Regs
        {
            get { return registers; }
        }

        public List<ReservationStation> RS
        {
            get { return reservationStations; }
        }

        public int RSSize
        {
            get { return reservationStationsCount; }
        }

        public Processor(int robEntriesCount, int instructionBufferSize, int reservationStationsCount, 
            int asUnits, int asCycles, int mulUnits, int mulCycles, int divUnits, int divCycles, int pc)
        {
            processor = this;
            this.ROB = new ReorderBuffer(robEntriesCount);
            this.instructionBuffer = new InstructionBuffer(instructionBufferSize, pc);
            this.reservationStationsCount = reservationStationsCount;
            ////////////////////
            this.registers = new int[8];

        }


        public void Flush()
        {
            ROB.Flush();
            ///////////////////
        }
    }
}
